
import datetime
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from applications.exts import db


# 商家表
class Store(db.Model,UserMixin):
    __tablename__ = 'wx_store'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True,comment='商家id')
    iconPath=db.Column(db.String(99),default='/static/mark.png',comment='商家图标')
    latitude=db.Column(db.String(10),comment='纬度')
    longitude=db.Column(db.String(10),comment='经度')
    title=db.Column(db.String(30),comment='店家名称')
    content=db.Column(db.String(99),comment='店家介绍')
    slogan=db.Column(db.String(99),comment='店家标语')
    enable=db.Column(db.Integer,default=1,comment='商家状态')
    is_del= db.Column(db.Integer,default=0,comment='商家是否删除')
    add_time = db.Column(db.DateTime,default=datetime.datetime.now(),comment='添加时间')
    update_time = db.Column(db.DateTime,comment='更新时间')

    def __str__(self):
        return self.id